package cn.xuguowen.user.designPatten.factory.customer_abstract_factory;

/**
 * ClassName: FactoryProducer
 * Package: cn.xuguowen.user.designPatten.factory.customer_abstract_factory
 * Description:
 * 获取工厂对象的——生成具体工厂对象的
 * @Author 徐国文
 * @Create 2023/4/27 14:44
 * @Version 1.0
 */
public class FactoryProducer {

    public static AbstractFactory getFactory(String choice) {
        if (choice.equalsIgnoreCase("SHAPE")) {
            return new ShapeFactory();
        } else if (choice.equalsIgnoreCase("COLOR")) {
            return new ColorFactory();
        }
        return null;
    }
}
